<?php
/*
	获取活动详情
*/
$id=$_SESSION['action_id'];
$fans = cfc('core')->get_fans($_SESSION['openid']);
$fansinfo = pdo_get('core_fans',array('id'=>$fans['id'],'uniacid'=>$_SESSION['uniacid']));
$return['info']['avatar']=$fansinfo['avatar'];
$return['time']=date('Y-m-d H:i:s',time());

$f = pdo_get('jy_h5game_fans',array('rid'=>$id,'uniacid'=>$_SESSION['uniacid'],'fansId'=>$_SESSION['uid']));

if($f['awardnum']!=1){
	$return['count']=pdo_count('jy_h5game_fans',array('rid'=>$id,'uniacid'=>$_SESSION['uniacid'],'awardnum'=>1));
	$return['count']=$return['count']+1;
	pdo_update('jy_h5game_fans',array('awardnum'=>1,'last_time'=>time(),'awardinfo'=>$return['count']),array('rid'=>$id,'uniacid'=>$_SESSION['uniacid'],'fansId'=>$_SESSION['uid']));
	$f = pdo_get('jy_h5game_fans',array('rid'=>$id,'uniacid'=>$_SESSION['uniacid'],'fansId'=>$_SESSION['uid']),array('headImg','name','awardinfo'));
	cfc('jinyun_socket')->send2room(json_encode($f),$id);
}else{
	$return['count']=$f['awardinfo'];
}
$return['rid']=$id;
$return['info']['nickname']=$fansinfo['nickname'];
$return['htmls']=$this->template_url('games/hd_lzqd/index');
exi($return);